<!DOCTYPE html>
<html lang="zh">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header :: header(~{::title},~{::link},~{})">

    <title>用户列表</title>
    <link rel="icon" th:href="@{/assets/img/lcxm.ico}" type="image/ico">
    <link rel="stylesheet" th:href="@{/assets/css/common.css}">
</head>
<body class="body">
<!--导航-->
<div th:replace="common/nav :: nav(true)"></div>
<div class="container">

    <div class="row row-nocol">


        <form class="form-inline lookup" role="form" method="post">


            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-name">项目名称</label>
                <div class="input-group">
                    <input class="form-control input-sm" id="lookup-name" name="name" type="text"
                           th:value="${pager.lookup?.name}" placeholder="项目名称">
                </div>
            </div>
            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-status">状态</label>
                <div class="input-group">
                    <input class="form-control input-sm" id="lookup-status" name="status" type="text"
                           th:value="${pager.lookup?.status}" placeholder="项目状态">
                </div>
            </div>

            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-jiraPrefix">jira前缀</label>
                <div class="input-group">
                    <input class="form-control input-sm" id="lookup-jiraPrefix" name="jiraPrefix" type="text"
                           th:value="${pager.lookup?.jiraPrefix}" placeholder="jira前缀">
                </div>
            </div>


            <div class="form-group pull-right">
                <button type="submit" class="btn btn-primary btn-sm">
                    <i class="glyphicon glyphicon-search"></i> 查询
                </button>
                <button type="button" class="btn btn-info btn-sm reset">
                    <i class="glyphicon glyphicon-refresh"></i> 重置
                </button>
            </div>

        </form>
        <hr/>
        <!-- 操作信息提示的地方 -->
        <div th:if="${remind}" class="alert alert-${ remind.level  }"
             th:classappend="'alert-' + ${remind.level}">
            <button data-dismiss="alert" class="close" type="button">
                <i class="glyphicon glyphicon-remove"></i>
            </button>
            <span th:remove="tag" th:utext="${ remind.message }"></span>
        </div>
        <!--列表栏-->
        <form class="nocol">

            <div class="action-bar">
                <a th:if="${session.principal?.isManager()}" class="btn btn-sm btn-success" th:href="@{/project/form}"
                   data-toggle="tooltip" title="新增项目">
                    <i class="glyphicon glyphicon-plus"></i> 新增项目
                </a>
            </div>

            <table class="table table-striped  table-hover table-bordered stable">
                <thead>
                <tr class="text-center">
                    <th>项目名称</th>
                    <th>状态</th>
                    <th>jira前缀</th>
                    <th>预计工时(分钟)</th>
                    <th>创建人(项目经理)</th>
                    <th>备注</th>
                    <th class="text-info">操作</th>
                </tr>
                </thead>
                <tbody align="center">
                <tr th:each="cur:${pager?.datas}">
                    <td>
                        <a th:text="${#strings.abbreviate(cur.name,15)}"
                           th:onclick="common.reportTotalTime([[${cur.id}]])"
                           data-toggle="tooltip"
                           th:title="${cur.name}"></a>
                    </td>
                    <td th:text="${cur.status}">status</td>
                    <td th:text="${cur.jiraPrefix}">jiraPrefix</td>
                    <td th:text="${cur.duration}">duration</td>
                    <td th:text="${cur.createName}">usedTime</td>
                    <td>
                        <a th:text="${#strings.abbreviate(cur.note,20)}" data-toggle="tooltip" th:title="${cur.note}">2021-12-12</a></td>
                    </td>

                    <td>
                        <div class="btn-group-dis">
                            <button th:if="${cur.couldEdit} and ${cur.status != 'CLOSED'}" class="btn btn-xs btn-danger action-get" type="button"
                                    th:attr="data-url='/project/close/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="关闭" data-confirm="确定关闭当前项目吗？对于关闭状态的项目，不再可填写工时, 也不再进行汇总统计">
                                <i class="glyphicon glyphicon-eye-close"></i>
                            </button>
                            <button th:if="${cur.couldEdit} and ${cur.status != 'OPEN'}" class="btn btn-xs btn-primary action-get" type="button"
                                    th:attr="data-url='/project/open/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="打开" data-confirm="确定打开当前项目吗？打开后，可填写工时, 并进行汇总统计">
                                <i class="glyphicon glyphicon-eye-open"></i>
                            </button>
                            <button th:if="${cur.couldEdit}" class="btn btn-xs btn-info action-get" type="button"
                                    th:attr="data-url='/project/edit/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="编辑" data-confirm="确定需要编辑当前项目吗?">
                                <i class="glyphicon glyphicon-edit"></i>
                            </button>

                            <button th:if="${cur.couldEdit}" class="btn btn-xs btn-success action-get" type="button"
                                    th:attr="data-url='/project/projectUser/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="人员管理" data-confirm="确定前往当前项目的人员管理吗?">
                                <i class="glyphicon glyphicon-user"></i>
                            </button>
                            <button th:if="${cur.couldDelete}" class="btn btn-xs btn-danger action-get" type="button"
                                    th:attr="data-url='/project/delete/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="删除" data-confirm="确认删除本条记录吗">
                                <i class="glyphicon glyphicon-trash"></i>
                            </button>
                        </div>
                    </td>
                </tr>
                <!-- </c:forEach> -->
                </tbody>
            </table>

        </form>
        <!--页码相关-->
        <div th:replace="common/pager :: pager"></div>
    </div>


</div>

<!-- 引入通用js-->
<div th:replace="common/footer :: footer"></div>
<script>
    function clickContent(e) {
        $.alert({
            theme: 'bootstrap',
            title: '工作内容',
            content: e.title
        });
    }

    function clickDate(id) {
        $.alert({
            theme: 'bootstrap',
            title: '当日工作详情',
            columnClass: 'col-md-10 col-md-offset-1',
            content: "url:" + (ctx + "report/day/" + id)
        });
    }

</script>
</body>
</html>